
############# (Define variables) #############

# for common things
PROGRAM			= FlowTest2
VERSION			= Make v1.0 of doddeg
CXX			= g++
CXXCONDOR		= condor_compile gcc
CXXFLAGS		= -Wall -fPIC 


#for ROOT settings
CXXFLAGS        = $(shell root-config --cflags)
LIBS            = $(shell root-config --libs)


# Including Headers, Sources (.h and .cxx) 
HDRS			= FlowToyMCBase.h 
SRCS			= $(HDRS:.h=.cxx)
OBJS			= $(HDRS:.h=.o)


############  (Complie) ####################


%.o : %.cxx %.h
	$(COMPILE.cc) $(INCS) -c $< -o $@
#1st line define dependency
#2nd line compile with $< (input file) with output name $@ (target file)


$(PROGRAM) : $(OBJS) $(HDRS) $(PROGRAM).C
	@echo "*****************************************************"
	@echo "Start making Main Code with $(VERSION)"
	@echo "*****************************************************"
	$(CXX) $(CXXFLAGS) $(OBJS) $(PROGRAM).C $(LIBS) $(INCS) -o $(PROGRAM)
	@echo "$(PROGRAM) - done"
#complie with above option, main code

condor	: $(OBJS) $(REF) $(HDRS) $(PROGRAM).C
	@echo "*****************************************************"
	@echo "Start making Main Code with $(VERSION)"
	@echo "*****************************************************"
	$(CXX_CONDOR) $(OBJS) $(PROGRAM).C $(LIBS) $(INCS) -o $(PROGRAM)
	@echo "$(PROGRAM) - done"


############  (For other argument 'clean' etc.) #################

clean	:
	@echo cleaning up
	rm -f $(OBJS) $(PROGRAM).o $(PROGRAM)
#clean does not need any dependency
#just remove files

debug : 
	echo $(OBJS)

show	:
	@echo "This version is first version of doddeng's makefile"


